from atsonic_ungc import AtsonicBuffer

# Allocate a 64MB zero-copy buffer bypassing CPython GC tracking
buffer = AtsonicBuffer(64 * 1024 * 1024)

# Ingest raw byte chunk via e2pass interface
data = b"High-throughput payload data stream"
bytes_written = buffer.write_e2pass_chunk(data)

# Read raw bytes directly from Rust memory slice
result = buffer.read_bytes()
print(f"Ingested {bytes_written} bytes with zero GC overhead.")